using UnityEngine;
using System.Collections;

public class GameCamera : MonoBehaviour {

	public float verticalFollowVelocity, horizontalFollowVelocity;
	public float discanceLimit;
	public float bottomLimit;
	public GameObject cam;
	public GameObject Player;
	void Start () {
	
	}
	void Update () 
	{
		if(cam.transform.position.y >= bottomLimit)
		{
			cam.transform.Translate(0,(Player.transform.position.y - transform.position.y)/(1/verticalFollowVelocity),0);
		}else
		{
			if((Player.transform.position.y > cam.transform.position.y))
			{
				cam.transform.Translate(0,(Player.transform.position.y - transform.position.y)/(1/verticalFollowVelocity),0);
			}
		}
		cam.transform.Translate((Player.transform.position.x - transform.position.x)/(1/horizontalFollowVelocity),0,0);
		
	}
}
